package com.jyk.blog.service.impl;

import com.jyk.blog.mapper.TypeMapper;
import com.jyk.blog.po.Type;
import com.jyk.blog.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TypeServiceImpl implements TypeService {

    @Autowired
    TypeMapper typeMapper;

    @Override
    public List<Type> queryAll() {
        return typeMapper.findAll();
    }

    @Override
    public Type queryById(int id) {
        return typeMapper.findById(id);
    }

    @Override
    public Type queryByName(String name) {
        return typeMapper.findByName(name);
    }

    @Override
    public void insertOne(String typeName) {
        typeMapper.insertOne(typeName);
    }

    @Override
    public void deleteOne(Type type) {
        typeMapper.deleteOne(type);
    }
}
